package com.lidong.lowcode.database.annotation;

import com.lidong.lowcode.database.constants.database.SqlColumnEnum;

import java.lang.annotation.*;

/**
 * @author LiDong
 * @version 1.0.0
 * @createTime 9/8/2022 9:38 PM
 */
// This annotation is used to field
@Target(ElementType.FIELD)
// When  run is  effective
@Retention(RetentionPolicy.RUNTIME)
// Java document annotation
@Documented
public @interface ColumnType {

    /**
     * 类型
     *
     * @return SqlColumnEnum
     */
    SqlColumnEnum type() default SqlColumnEnum.DEFAULT;

    /**
     * 字段长度，默认是255
     *
     * @return 字段长度，默认是255
     */
    int length() default 255;

    /**
     * 小数点长度，默认是0
     *
     * @return 小数点长度，默认是0
     */
    int decimalLength() default 0;
}
